package com.wondersgroup.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.wondersgroup.model.ConfigBean;

@RestController
@Profile(value="test")
public class TestController {
	
	@Autowired
	ConfigBean configBean;
	
	@Value("${dudu.secret}")
	private String secret;
	
	@GetMapping("/helloworld")
	public String helloworld(){
		return configBean.getName() + ":" + configBean.getAge();
	}
	
	@GetMapping("/helloworld2")
	public String helloworld2(){
		return "random.value:"+secret;
	}
}
